<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>admin_add</title>
		<link rel="shortcut icon" href="../images/my/favicon.ico" />
		<link rel="bookmark" href="../images/my/favicon.ico" />
		<link rel="stylesheet" href="../../../statics/layui/css/layui.css" />
		<link rel="stylesheet" href="../../../css/admin/common.css" />
		<link rel="stylesheet" href="../../../css/admin/update_my_base_info.css" />
	</head>

	<body style="background: #F6F6F6;">
		<div class="layui-fluid">
			<div class="layui-row">
				<div class="layui-col-md12">
					<div class="layui-card layui-anim layui-anim-upbit">
						<div class="layui-card-header">添加新任务
							<span class="btn_right">
								<button type="button" id="back" title="返回" class="layui-btn layui-btn-normal layui-btn-xs" onclick="javascript:window.history.back(-1);"><i class="layui-icon">&#xe65c;</i>返回上一页</button>
								<button type="button" id="refresh" title="刷新" class="layui-btn layui-btn-normal layui-btn-xs"><i class="layui-icon layui-icon-refresh"></i></button>
							</span>
						</div>
						<div class="layui-card-body">
							<form class="layui-form" action="">
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs12">任务名称：</label>
									<div class="layui-col-md10 layui-col-sm10 layui-col-xs12">
										<input type="text" name="jobName" required lay-verify="required" autocomplete="off" placeholder="任务名称" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs12">任务描述：</label>
									<div class="layui-col-md10 layui-col-sm10 layui-col-xs12">
										<input type="text" name="jobDesc" required lay-verify="required" autocomplete="off" placeholder="任务描述" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs12">类路径：</label>
									<div class="layui-col-md10 layui-col-sm10 layui-col-xs12">
										<select name="jobClassName" lay-search lay-verify="required" id="jobs">
										  
										</select>     
									</div>
								</div>
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs12">任务分组：</label>
									<div class="layui-col-md10 layui-col-sm10 layui-col-xs12">
										<input type="text" name="jobGroupName" required lay-verify="required|mypassword" placeholder="任务分组(如：201809)" autocomplete="off" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs12">cron表达式：</label>
									<div class="layui-col-md10 layui-col-sm10 layui-col-xs12">
										<input type="text" name="cron" required lay-verify="required|mypassword" placeholder="cron表达式" autocomplete="off" class="layui-input">
									</div>
								</div>
								<div class="layui-form-item layui-row">
									<label class="my_layui-form-label layui-col-md1 layui-col-sm1 layui-col-xs1 layui-hide-xs">&nbsp;</label>
									<button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo"></i><span>添加任务</span></button>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="../../../statics/layui/layui.js"></script>
		<script type="text/javascript" src="../../../statics/lay/system/admin/public.js" ></script>
		<script>
			layui.use(['layer', 'form'], function() {
				var layer = layui.layer,
					$ = layui.$,
					form = layui.form;
				//表单监听提交
				showJobClass("jobs");
				form.render();
				form.on('submit(formDemo)', function(data) {
					$.ajax({
						url: IP + '/api/teacher_eav/quartz/addjob',
						type: 'POST',
						data: JSON.stringify(data.field),
						success: function(result, status, xhr) {
							layer.closeAll('loading');
							layer.msg("成功", {
								icon: 1,
								time: 1000
							},function(){
								window.history.back(-1);
							});
						}
					});
					return false;
				});
				
			});
		</script>
	</body>

</html>